package com.cgt.day5.Exercise;

public abstract class Person {
//    抽象父类
    protected int id;
    protected int age;
    protected String name;
    protected String gender;
//  protected修饰符表示属性只可以由自己类内部，自己的子类访问
    public Person(){
        super();
//        调用父类构造方法
    }

    public Person(int id, int age, String name, String gender) {
        super();
        this.id = id;
        this.age = age;
        this.name = name;
        this.gender = gender;
    }

    public void show(){
        System.out.println("Person.show");
    }

    public abstract String getRoomName();
//    父类的抽象方法

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", age=" + age +
                ", name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                '}';
    }
//    toString()
}
